<template>
  <div id="app">
    <form-error :feshow="global_error_show" :stext="global_error_text"></form-error>
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive"></router-view>
  </div>
</template>

<script>
import FormError from '@/components/formerror'
import { mapState } from 'vuex'
export default {
  name: 'App',
  components: {
    FormError
  },
  data () {
    return {}
  },
  computed: {
    ...mapState(['global_error_show', 'global_error_text'])
  },
  mounted () {
    document.body.addEventListener('touchmove', function (evt) {
      // In this case, the default behavior is scrolling the body, which
      // would result in an overflow.  Since we don't want that, we preventDefault.
      if (!evt._isScroller) {
        evt.preventDefault()
      }
    })
  }
}
</script>

<style lang="stylus" scoped>
#app
  background-color: #f5f5f5
</style>
